<template>
  <div>
<ul>
    <li v-for="item in admins" :key="item" :class="{active:currentSession?item.username === currentSession.username:false}"
    v-on:click="changeCurrentSessionId(item)"
    >
    <img src="item.useeFace" :alt="item.name">
    <el-badge :is-dot="[user.username+'#'+item.username]">{{item.name}}</el-badge>
    <p >{{item.name}}</p>
    </li>
</ul>
  </div>
</template>

<script>
import { mapState } from 'vuex'
export default {
data() {
    return {
        user:JSON.parse(window.sessionStorage.getItem('user'))
    }
},
methods:{
    changeCurrentSession(currentSession){
        this.$store.commit('changecurrentsession',currentSession)
    }
},
computed: mapState([
    'sessions',
    'admins',
    'currentSession'
])
}
</script>

<style>

</style>